/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * GenActionPane.java
 *
 * Created on Jun 28, 2009, 4:08:55 PM
 */

package org.dbdir.client.gui;

import org.dbdir.Client;

/**
 *
 * @author thotheolh
 */
public class GenActionPane extends javax.swing.JPanel {

    Client client;
    MainFrame frame;

    /** Creates new form GenActionPane */
    public GenActionPane(Client client,MainFrame frame) {
        initComponents();
        this.setSize(293,139);
        this.client = client;
        this.frame = frame;
    }

    public void init(){
        this.setUsername(client.getUsername());
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        headPane = new javax.swing.JPanel();
        welcomeLbl = new javax.swing.JLabel();
        usrLbl = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        personalBtn = new javax.swing.JButton();
        dbProfBtn = new javax.swing.JButton();

        setLayout(new java.awt.BorderLayout());

        headPane.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));

        welcomeLbl.setFont(new java.awt.Font("DejaVu Sans", 1, 13));
        welcomeLbl.setText("Welcome, ");
        headPane.add(welcomeLbl);
        headPane.add(usrLbl);

        jLabel1.setFont(new java.awt.Font("DejaVu Sans", 1, 13));
        jLabel1.setText(".");
        headPane.add(jLabel1);

        add(headPane, java.awt.BorderLayout.NORTH);

        jPanel1.setLayout(new java.awt.GridBagLayout());

        personalBtn.setText("Change Personal Profile");
        personalBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                personalBtnActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 20, 0);
        jPanel1.add(personalBtn, gridBagConstraints);

        dbProfBtn.setText("Manage DB Profile");
        dbProfBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                dbProfBtnActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.ipadx = 34;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 20, 0);
        jPanel1.add(dbProfBtn, gridBagConstraints);

        add(jPanel1, java.awt.BorderLayout.CENTER);
    }// </editor-fold>//GEN-END:initComponents

    private void personalBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_personalBtnActionPerformed
        // TODO add your handling code here:
        frame.getPersonalPane();
    }//GEN-LAST:event_personalBtnActionPerformed

    private void dbProfBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dbProfBtnActionPerformed
        // TODO add your handling code here:
        frame.getManDBPane();
    }//GEN-LAST:event_dbProfBtnActionPerformed

    public void setUsername(String username){
        usrLbl.setText(username);
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton dbProfBtn;
    private javax.swing.JPanel headPane;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JButton personalBtn;
    private javax.swing.JLabel usrLbl;
    private javax.swing.JLabel welcomeLbl;
    // End of variables declaration//GEN-END:variables

}
